package BaseRows
{
	import data.MyBorderContainer;
	
	import flash.events.ContextMenuEvent;
	import flash.ui.ContextMenu;
	import flash.ui.ContextMenuItem;
	
	/*
		scheduled Action row
	*/
	public class SArow
	{
		
		private var _startDataYear:uint=2012;
		private var _startDataMonth:uint=1;
		private var _startDataDay:uint=1;
		
		[Bindable]
		public var startData:String=_startDataYear.toString()+iToStr(_startDataMonth)+iToStr(_startDataDay);
		
		[Bindable]
		public var frequency:uint=1;
		[Bindable]
		public var frequencyUnit:String="year";
		
		[Bindable]
		public var capLoss:Number=100;
		
		public function SArow(_mbc:MyBorderContainer=null)
		{
		}
		
		[Bindable]
		public function get startDataDay():uint
		{
			return _startDataDay;
		}

		public function set startDataDay(value:uint):void
		{
			_startDataDay = value;
			startData = _startDataYear.toString()+iToStr(_startDataMonth)+iToStr(_startDataDay);
		}

		[Bindable]
		public function get startDataMonth():uint
		{
			return _startDataMonth;
		}

		public function set startDataMonth(value:uint):void
		{
			_startDataMonth = value;
			startData =_startDataYear.toString()+iToStr(_startDataMonth)+iToStr(_startDataDay);
		}

		[Bindable]
		public function get startDataYear():uint
		{
			return _startDataYear;
		}

		public function set startDataYear(value:uint):void
		{
			_startDataYear = value;
			startData = _startDataYear.toString()+iToStr(_startDataMonth)+iToStr(_startDataDay);
		}
		
		/*
			1자리 int를 2자리 string으로 치환
		*/
		private function iToStr(_n:uint):String{
			if(_n<10){
				return "0"+_n.toString();
			}
			return _n.toString();
		}
	}
}